﻿using System;
using System.Web.Configuration;

namespace VioletDevelopmentLaboratory.Net.Web.Configuration
{
	public sealed class TrustSectionManager : ConfigurationManagerBase
	{
		private TrustSection section;

		public TrustSectionManager()
		{
			this.section = (TrustSection)base.GetConfigurationSection("system.web/trust");
		}

		public void Modify(string level, string originUrl, bool processRequestInApplicationTrust)
		{
			this.section.Level = level;
			this.section.OriginUrl = originUrl;
			this.section.ProcessRequestInApplicationTrust = processRequestInApplicationTrust;
			this.Save();
		}
		public TrustSection GetTrustSection()
		{
			return this.section;
		}
	}
}
